package com.example.denglu.enums;

public enum GenderEnums {
    SCHOOLBOY("schoolboy",1,"男生"),
    SCHOOLGIRL("shcoolgirl",0,"女生");

  public final String code;
  public final  Integer num;
  public final  String name;

    public String getCode() {
        return code;
    }

    public Integer getNum() {
        return num;
    }

    public String getName() {
        return name;
    }

    GenderEnums(String code, Integer num, String name) {
      this.code = code;
      this.num = num;
      this.name = name;
  }
      public static GenderEnums forCode (String code) {
          for (GenderEnums item : GenderEnums.values()) {
              if (item.code.equals(code)) {
                  return item;
              }
          }
          return null;
      } public static String forName(String code) {
          for (GenderEnums item : GenderEnums.values()) {
              if (item.code.equals(code)) {
                  return item.name;
              }
          }
          return null;
      }

  }

